package com.one.common.common.login.model;

import com.one.common.model.bean.UserInfoBean;
import com.one.common.model.http.base.BaseResponse;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface LoginApi {

    /**
     * 发送验证码
     */
    @FormUrlEncoded
    @POST("/settingInterfaces/v1.0/sendCode")
    Observable<BaseResponse<String>> sendCode(@Field("mobile") String mobile,
                                              @Field("code_type") String codeType);

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST("/memberInterfaces/v1.0/registerMember")
    Observable<BaseResponse<UserInfoBean>> register(@FieldMap Map<String, String> params);

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("/memberInterfaces/v1.0/loginMember")
    Observable<BaseResponse<UserInfoBean>> login(@FieldMap Map<String, String> params);

    /**
     * 忘记密码
     */
    @FormUrlEncoded
    @POST("/memberInterfaces/v1.0/forgetPassword")
    Observable<BaseResponse<String>> forgetPwd(@FieldMap Map<String, String> params);

    /**
     * 微信app绑定手机号
     */
    @FormUrlEncoded
    @POST("/memberInterfaces/v1.0/wxAppBindMobile")
    Observable<BaseResponse<UserInfoBean>> bindPhone(@FieldMap Map<String, String> params);

    /**
     * 微信app登录
     */
    @FormUrlEncoded
    @POST("/memberInterfaces/v1.0/wxAppLoginMember")
    Observable<BaseResponse<UserInfoBean>> wxLogin(@Field("weixin_app_open_id") String open_id);

}
